using System.Windows;
using System.Windows.Input;

namespace CustomPlate
{
	public class Cell : BaseControl
	{
		public static readonly DependencyProperty HighLightProperty;

		public static readonly DependencyProperty IsInvalidProperty;

		public static readonly DependencyProperty IsGroupProperty;

		public bool HighLight
		{
			get
			{
				return (bool)GetValue(HighLightProperty);
			}
			set
			{
				SetValue(HighLightProperty, value);
			}
		}

		public bool IsInvalid
		{
			get
			{
				return (bool)GetValue(IsInvalidProperty);
			}
			set
			{
				SetValue(IsInvalidProperty, value);
			}
		}

		public bool IsGroup
		{
			get
			{
				return (bool)GetValue(IsGroupProperty);
			}
			set
			{
				SetValue(IsGroupProperty, value);
			}
		}

		static Cell()
		{
			HighLightProperty = DependencyProperty.Register("HighLight", typeof(bool), typeof(Cell), new PropertyMetadata(false));
			IsInvalidProperty = DependencyProperty.Register("IsInvalid", typeof(bool), typeof(Cell), new PropertyMetadata(false));
			IsGroupProperty = DependencyProperty.Register("IsGroup", typeof(bool), typeof(Cell), new PropertyMetadata(false));
			FrameworkElement.DefaultStyleKeyProperty.OverrideMetadata(typeof(Cell), new FrameworkPropertyMetadata(typeof(Cell)));
		}

		public override void OnApplyTemplate()
		{
			base.OnApplyTemplate();
		}

		protected override void OnMouseEnter(MouseEventArgs e)
		{
			HighLight = true;
			base.OnMouseEnter(e);
		}

		protected override void OnMouseLeave(MouseEventArgs e)
		{
			HighLight = false;
			base.OnMouseLeave(e);
		}
	}
}
